<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增联系人提醒')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-reminder-add">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">联系人ID：</label>
                    <div class="col-sm-8">
                        <input name="contactId" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">提醒类型：</label>
                    <div class="col-sm-8">
                        <select name="reminderType" class="form-control" th:with="type=${@dict.getType('contact_reminder_type')}" required>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">重复类型：</label>
                    <div class="col-sm-8">
                        <select name="reminderType" class="form-control" th:with="type=${@dict.getType('contact_reminder_type')}" required>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">提醒时间：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="reminderTime" id="reminderTime" class="form-control"
                                   placeholder="请选择提醒时间：年月日时分秒" type="text" required>
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">是否重复(0-否,1-是)：</label>
                    <div class="col-sm-8">
                        <input name="isRepeat" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "contact/reminder"
        $("#form-reminder-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-reminder-add').serialize());
            }
        }

        layui.use('laydate', function(){
        var laydate = layui.laydate;
        laydate.render({
        elem: '#reminderTime',
        type: 'datetime',
        trigger: 'click'
        });
        }); // layui.use()

    </script>
</body>
</html>